package com.edt.ichannel.api.common.constant;



import cc.edt.iceutils2.number.IceNumberUtils;
import com.edt.ichannel.api.common.entity.Config;

import java.io.Serializable;

/**
 * 系统常用常量
 *
 * @author 刘钢
 */
public class CommonConstant implements Serializable {



    private static final long serialVersionUID = -7828091876232562024L;

    /**
     * true=成功  false=失败
     */
    public final static boolean ACTIONRESULT_TRUE = true;
    public final static boolean ACTIONRESULT_FAIL = false;

    /**
     * 接口日志类型 1=CBSS身份证查询  2=ESS身份证查询  3=CBSS套餐查询  4=ESS套餐查询  5=CBSS流量充值  6=ESS流量充值
     * 7=三户查询  8=获取accesstoken  9=获取openId  10=发送短信 11=生成短链接  50=工单二期订单接收  18=推送微信模板消息
     */
    public static final int INTERFACE_TYPE_USERIDENTITY_CBSS = 1;
    public static final int INTERFACE_TYPE_USERIDENTITY_ESS = 2;
    public static final int INTERFACE_TYPE_PACKAGEINFO_CBSS = 3;
    public static final int INTERFACE_TYPE_PACKAGEINFO_ESS = 4;
    public static final int INTERFACE_TYPE_TRAFFIC_CBSS = 5;
    public static final int INTERFACE_TYPE_TRAFFIC_ESS = 6;
    public static final int INTERFACE_TYPE_SNAHU = 7;
    public static final int INTERFACE_TYPE_GETACCESSTOKEN = 8;
    public static final int INTERFACE_TYPE_GETOPENID = 9;
    public static final int INTERFACE_TYPE_SENDSMS10010 = 10;
    public static final int INTERFACE_TYPE_CREATESHORTURL = 11;// 生成短链接
    public static final int INTERFACE_TYPE_SYNMECHANISMS = 99;//同步组织机构
    public static final int INTERFACE_TYPE_SYNSTAFF = 98;//同步人员
    public static final int INTERFACE_TYPE_COLLECT_CONSUME = 14;
    public static final int INTERFACE_TYPE_COLLECT_EXCHANGE = 15;
    public static final int INTERFACE_TYPE_SYNORDERCHANNEL = 16; //同步发展订单
    public static final int INTERFACE_TYPE_SYNFIRSTCHARGE = 17;//同步首充
    public static final int INTERFACE_TYPE_SYNFACCOUTCOMPARE = 18;//同步对账
    public static final int INTERFACE_TYPE_SYNACTIVITYSTAFF = 19; //同步发展订单
    public static final int INTERFACE_TYPE_GAWOTWOCOLLECT = 50;//工单二期订单接收（正式单）
    public static final int INTERFACE_TYPE_GAWOTWOCOLLECT_PASS = 51;//工单二期订单接收(意向单)
    public static final int INTERFACE_TYPE_WOPAY = 60;//沃支付
    public static final int INTERFACE_TYPE_SENDWECHATTEMPLATE = 20;//推送微信模板消息
    public static final int INTERFACE_TYPE_SELECT_FIRST_MONEY = 30;//查询首充
    public static final int INTERFACE_TYPE_SYN_SELECT_FIRST_MONEY_MONTY = 32;//推送kafka月文件
    public static final int INTERFACE_TYPE_SYNALLEXPANSION = 31; //同步发展订单

    public static final int INTERFACE_TYPE_URL_UNICOMPAY = 61 ;//联通支付
    public static final int INTERFACE_TYPE_URL_UNICOMPAY_BATCH = 62 ;//联通支付
    public static final int INTERFACE_TYPE_GETRHKDBYNUMBERTEL = 64;
    public static final int INTERFACE_TYPE_GETCITYCODEBYNAME = 65;
    public static final int INTERFACE_TYPE_SYNORDERCHANNELFXQYZX = 66; //同步放心权益中心数据
    public static final int INTERFACE_TYPE_JZQD= 67;
    /**
     * 接口调用状态 1=成功  0=失败
     */
    public static final int CALL_STATE_SUCCESS = 1;
    public static final int CALL_STATE_FAIL = 0;

    /**
     * ESS生效时间 NOW=立即生效 NEXTMONTH=次月生效 2=次月生效
     */
    public final static String ENABLE_TAG_EFFECT_NOW_ESS = "NOW";
    public final static String ENABLE_TAG_EFFECT_NEXT_MONTH_ESS = "NEXTMONTH";
    public final static String ENABLE_TAG_EFFECT_NEXT_MONTH = "2";

    /**
     * 操作类型 O=订购 C=订购 00=订购
     */
    public final static String OPT_TAG_ORDER_ESS = "O";
    public final static String OPT_TAG_UNSUBSCRIBE_ESS = "C";
    public final static String OPT_TAG_ORDER = "00";

    /**
     * 查询类型，默认不填写为USER CUST=客户信息 USER=用户信息 ACCT=账户信息
     */
    public final static String INFOLIST_CUST = "CUST";
    public final static String INFOLIST_USER = "USER";
    public final static String INFOLIST_ACCT = "ACCT";

    /*******************数据库常量**********************/
    public final static String CONFIG_ERRORMSG = Config.mapConfig.get("errormsg");

    //获取微信ACCESSTOKEN
    public final static String URL_GETACCESSTOKEN = Config.mapConfig.get("url_getAccesstoken");

    // 流量订购/退订接口接口地址CBSS
    public final static String URL_TRAFFIC = Config.mapConfig.get("url_traffic");
    // 流量订购/退订接口接口地址ESS
    public final static String URL_TRAFFIC_ESS = Config.mapConfig.get("url_trafficEss");
    // ESS的身份证查询接口
    public final static String URL_SANHU = Config.mapConfig.get("url_sanHu");
    // 中控用户名
    public final static String USER_EDTAPI = Config.mapConfig.get("user_edtapi");
    // 中控密码
    public final static String PWD_EDTAPI = Config.mapConfig.get("pwd_edtapi");
    public final static String URL_GAWOTWO_COLLECTORDER = Config.mapConfig.get("url_gawotwo_collectorder");//工单二期正式单抢派接口
    public final static String URL_GAWOTWO_COLLECTORDER_PASS = Config.mapConfig.get("url_gawotwo_collectorder_pass");//工单二期意向单测试接口地址

    public final static String ACTIONRESULT_MESSAGE_NULL = "接收参数为空";
    public final static String ACTIONRESULT_MESSAGE_FORMATEERROR = "参数格式不正确";
    public final static String ACTIONRESULT_MESSAGE_SERVICEERROR = "接口服务错误，看见此错误请联系接口方";
    public static final String REQUEST_METHOD_POST = "POST";
    public static final String JDBC_DRIVER_NAME = Config.mapConfig.get("jdbcDriverName");
    public static final String JDBC_URL = Config.mapConfig.get("jdbcUrl");
    public static final String JDBC_USERNAME = Config.mapConfig.get("jdbcUserName");
    public static final String JDBC_PASSWORD = Config.mapConfig.get("jdbcPassword");
    public static final String PARENT_ID_XW = Config.mapConfig.get("parentIdXw");
    public static final String MECHANISMS_CITYCODES = Config.mapConfig.get("cityCodes");
    public static final String PROVINCE_CITY_CODE = Config.mapConfig.get("provinceCode");

    /**
     * 同步文件相关
     */
    public static final String SPLIT_CHAR_SG = "|";
    public static final String SPLIT_CHAR_ZYSG = "\\|";
    public static final int SYN_ORDERICAHNNEL_DAY = IceNumberUtils.toInt(Config.mapConfig.get("synOrderchannelDay"), -1);
    public static final String FILE_NAME_PREFIX_SYNORDERCHANNEL = Config.mapConfig.get("synOrderChannelPrefix");
    public static final String FILE_NAME_EXTEND_SYNORDERCHANNEL = Config.mapConfig.get("synOrderChannelExtend");
    public static final String FILE_NAME_SUBFIX_SYNORDERCHANNEL = Config.mapConfig.get("synOrderChannelSubfix");

    public static final int SYN_ORDERICAHNNEL_MONTH = IceNumberUtils.toInt(Config.mapConfig.get("synOrderchannelMonth"), -1);
    public static final String FILE_NAME_PREFIX_SYNORDERCHANNEL_MONTH = Config.mapConfig.get("synOrderChannelMonthPrefix");
    public static final String FILE_NAME_EXTEND_SYNORDERCHANNEL_MONTH = Config.mapConfig.get("synOrderChannelMonthExtend");
    public static final String FILE_NAME_SUBFIX_SYNORDERCHANNEL_MONTH = Config.mapConfig.get("synOrderChannelMonthSubfix");


    public static final String JF_FTP_HOST = Config.mapConfig.get("jfFtpHost");
    public static final String JF_FTP_PASSWPRD = Config.mapConfig.get("jfFtpPassword");
    public static final String JF_FTP_USERNAME = Config.mapConfig.get("jfFtpUsername");
    public static final int JF_FTP_PORT = IceNumberUtils.toInt(Config.mapConfig.get("jfFtpPort"), 21);
    public static final String JF_FTP_PATH = Config.mapConfig.get("jfFtpPath");
    public static final String JF_FTP_TMEP_PATH = Config.mapConfig.get("jfFtpTempPath");
    public static final int FIELD_COUNT_FIRST_CHARGE = 8;

    public static final String JF1_FTP_HOST = Config.mapConfig.get("j1fFtpHost");
    public static final String JF1_FTP_PASSWPRD = Config.mapConfig.get("jf1FtpPassword");
    public static final String JF1_FTP_USERNAME = Config.mapConfig.get("jf1FtpUsername");
    public static final int JF1_FTP_PORT = IceNumberUtils.toInt(Config.mapConfig.get("jf1FtpPort"), 21);
    public static final String JF1_FTP_PATH = Config.mapConfig.get("jf1FtpPath");


    public static final String JF_FTP_CHARSET = "utf-8";
    public static final int BRANCH_COUNT = 500;
    public static final int SYN_SYNFIRSTCHARGEL_DAY = IceNumberUtils.toInt(Config.mapConfig.get("synFirstChargeDay"), -1);
    public static final String FILE_NAME_PREFIX_SYNFIRSTCHARGE = Config.mapConfig.get("synFirstChargePrefix");
    public static final String FILE_NAME_EXTEND_SYNFIRSTCHARGE = Config.mapConfig.get("synFirstChargeExtend");
    public static final String FILE_NAME_SUBFIX_SYNFIRSTCHARGE = Config.mapConfig.get("synFirstChargeSubfix");


    public static final int SYN_SYNACCOUNTCOMPARE_DAY = IceNumberUtils.toInt(Config.mapConfig.get("synAccontCompareDay"), -1);
    public static final String DZ_FTP_HOST = Config.mapConfig.get("dzFtpHost");
    public static final String DZ_FTP_PASSWPRD = Config.mapConfig.get("dzFtpPassword");
    public static final String DZ_FTP_USERNAME = Config.mapConfig.get("dzFtpUsername");
    public static final int DZ_FTP_PORT = IceNumberUtils.toInt(Config.mapConfig.get("dzFtpPort"), 21);
    public static final String DZ_FTP_PATH = Config.mapConfig.get("dzFtpPath");
    public static final String DZ_FTP_TMEP_PATH = Config.mapConfig.get("dzFtpTempPath");
    public static final String DZ_FTP_CHARSET = "gbk";

    /**
     * 计算佣金相关
     */

    public static final int ACCOUNT_LOT_STATE_SUCCESS = 1;
    public static final int ACCOUNT_LOT_STATE_FAIL = 0;

    public static final int ACCOUNT_LOT_TYPE_COMMISSION = 1;
    public static final int ACCOUNT_LOT_TYPE_CASH = 2;
    public static final String BATCH_CODE_KEY = "BATCH_CODE_KEY";
    public static final String LOCK_KEY_TRAFFIC = "traffic_";
    public static final String LOCK_KEY_EXPANSION = "EXPANSION_";
    public static final String LOCK_KEY_STAFF = "STAFF_";
    public static final long LOCK_TRAFFIC_TIMEOUT = IceNumberUtils.toInt(Config.mapConfig.get("trafficTimeOut"), 10) * 1000L;
    public static final long LOCK_EXPANSION_TIMEOUT = IceNumberUtils.toInt(Config.mapConfig.get("trafficTimeOut"), 10) * 1000L;
    public static final String KEY_SYSTYPE = "sysType";
    public static final String KEY_SANHU = "sanhu_";
    public static final String KEY_ACCESSTOKEN = "access_token";
    public static final String KEY_USERINFO = "userInfo";

    public final static String CONFIG_APPID = Config.mapConfig.get("appid");
    public final static String WX_TEMPLATE_ID = Config.mapConfig.get("wx_template_id");


    //沃支付
    public static final String CONFIG_WO_CALLBACKCER = Config.mapConfig.get("wo_callBackCer");//回调验签的证书
    public static final String CONFIG_WO_CERPATH = Config.mapConfig.get("wo_cerPath");//
    /**
     * 小微渠道提现REDIS前缀
     */
    public final static String CONFIG_WO_REDISPAYKEY = Config.mapConfig.get("wo_redisPayKey");
    /**
     * 拓展人提现REDIS前缀
     */
    public final static String CONFIG_WO_STAFF_REDIS_PAY_KEY = Config.mapConfig.get("wo_staff_redisPayKey");

    public final static String URL_SINGLEISSUESERVLET = Config.mapConfig.get("url_singleIssueServlet");
    ;//提现REDIS前缀

    /**
     * 红包sftp
     */
    public static final String RED_PACKAGE_SFTP_USERNAME = Config.mapConfig.get("redPackageSftpUserName");
    public static final String RED_PACKAGE_SFTP_PASSWORD = Config.mapConfig.get("redPackageSftpPassword");
    public static final String RED_PACKAGE_SFTP_HOST = Config.mapConfig.get("redPackageSftpHost");
    public static final int RED_PACKAGE_SFTP_PORT = IceNumberUtils.toInt(Config.mapConfig.get("redPackageSftpPort"), 22);
    public static final String RED_PACKAGE_SFTP_TEMP_PATH = Config.mapConfig.get("redPackageSftpTempPath");
    public static final String RED_PACKAGE_SFTP_UPLOAD_PATH = Config.mapConfig.get("redPackageSftpUploadPath");
    public static final String RED_PACKAGE_SFTP_DOWNLOAD_PATH = Config.mapConfig.get("redPackageSftpDownloadPath");
    public static final String URL_GET_CITY = Config.mapConfig.get("urlGetCity");
    public static final String MERCHANT_CODE = "9700";
    public static final String KEY_CITYCODE = "districtCode";
    public static final int FIELD_COUNT_REDPACKET_RESULT = 12;
    public static final int SYN_RED_PACKET_ORDER_DAY = IceNumberUtils.toInt(Config.mapConfig.get("synRedPacketOrderDay"), -1);
    public static final int SYN_RED_PACKET_ORDER_RESULT_DAY = IceNumberUtils.toInt(Config.mapConfig.get("synRedPacketOrderResultDay"), 0);

    /**
     * 全量合伙人sftp-->网格
     */
    public static final String WG_SFTP_USERNAME = Config.mapConfig.get("wgSftpUserName");
    public static final String WG_SFTP_PASSWORD = Config.mapConfig.get("wgSftpPassword");
    public static final String WG_SFTP_HOST = Config.mapConfig.get("wgSftpHost");
    public static final int WG_SFTP_PORT = IceNumberUtils.toInt(Config.mapConfig.get("wgSftpPort"), 23);
    public static final String WG_SFTP_UPLOAD_PATH = Config.mapConfig.get("wgSftpUploadPath");

    //佣金日志状态
    public static final int BONUS_LOT_STATE_SUCCESS = 1;
    public static final int BONUS_LOT_STATE_FAIL = 2;

    /**
     * 网关发送号码一天发送数量前缀
     */
    public static final String SEND_NUMBER_DAY_MAX_REDIS_PREFIX = Config.mapConfig.get("sendNumberDayMaxRedisPrefix");
    /**
     * 网关发送号码一小时发送数量前缀
     */
    public static final String SEND_NUMBER_HOUR_MAX_REDIS_PREFIX = Config.mapConfig.get("sendNumberHourMaxRedisPrefix");

    public static final int STAFF_TYPE_ZY = 1;
    public static final int STAFF_TYPE_CB = 2;
    public static final int STAFF_TYPE_QUANY = 3;
    public static final int STAFF_TYPE_QIANY = 4;
    public static final String ORDER_TYPE_STAFF = "2";
    public static final String ORDER_TYPE_EXPASION = "1";
    public static final int EXPANSION_LEVEL_SECOND = 2;
    public static final int EXPANSION_LEVEL_FIRST = 1;
    public static final int EXPANSION_LEVEL_ZERO = 0;
    public static final int STAFF_STATE_HAS = 1;
    public static final int STAFF_STATE_NOT_HAS = 2;


    public static final String K_FTP_HOST = Config.mapConfig.get("KFtpHost");
    public static final String K_FTP_PASSWPRD = Config.mapConfig.get("KFtpPassword");
    public static final String K_FTP_USERNAME = Config.mapConfig.get("KFtpUsername");
    public static final int K_FTP_PORT = IceNumberUtils.toInt(Config.mapConfig.get("KFtpPort"), 21);
    public static final String K_FTP_PATH = Config.mapConfig.get("KFtpPath");
    public static final String K_FTP_CHARSET = "gbk";


    public static final String URL_SELECT_FIRST_MONEY = Config.mapConfig.get("selectFirstMoneyUrl");
    public static final String URL_SELECT_RELATION = Config.mapConfig.get("selectRelation");
    public static final String RSP_CODE_SUCCESS = "0000";
    public static final String RSP_CODE_0001 = "0001";
    public static final String RSP_CODE_0002 = "0002";
    public static final String NET_TYPE_CODE_YW = "50";
    public final static int NUMBER_TYPE_CK = 1;
    public final static int NUMBER_TYPE_KD = 2;

    //发短信 接口地址
    public final static String URL_SENDSMS10010 = Config.mapConfig.get("url_sendsms10010");

    public final static int SETTLET_TYPE_YJ = 1;
    public final static int SETTLET_TYPE_ZF = 2;
    public final static String SETTLET_TYPE_YJ_STR = "1";
    public final static String SETTLET_TYPE_ZF_STR = "2";

    public final static int PRODUCT_TYPE_SINGLE = 1;
    public final static int PRODUCT_TYPE_RELATION = 2;
    public final static int FLOW_OVER = 1;
    public final static int FLOW_NOT_OVER = 2;
    public final static String MONTH_FLOW_OVER = "1";
    public final static String MONTH_FLOW_NOT_OVER = "2";

    public final static String URL_UNICOMPAY = Config.mapConfig.get("url_unicompay");
    public final static String URL_UNICOMPAY_BATCH = Config.mapConfig.get("url_unicompay_batch");

    public static final String CODE_UNICOM_SUCCESS = "0000";
    public static final String MD5_KEY_UNICOMPAY = Config.mapConfig.get("md5keyuncompay");
    public static final String TX_UNICOMPAY = Config.mapConfig.get("tx");
    public static final String ROLEID_UNICOMPAY = Config.mapConfig.get("roleid");

    public static final String UNICOMPAY_SFTP_USERNAME = Config.mapConfig.get("unicomSftpUserName");
    public static final String UNICOMPAY_SFTP_PASSWORD = Config.mapConfig.get("unicomSftpPassword");
    public static final String UNICOMPAY_SFTP_HOST = Config.mapConfig.get("unicomSftpHost");
    public static final int UNICOMPAY_SFTP_PORT = IceNumberUtils.toInt(Config.mapConfig.get("unicomSftpPort"), 22);
    public static final String UNICOMPAY_SFTP_TEMP_PATH = Config.mapConfig.get("unicomSftpTempPath");
    public static final String UNICOMPAY_SFTP_DOWNLOAD_PATH = Config.mapConfig.get("unicomSftpDownloadPath");
    public static final String UNICOMPAY_SFTP_UPLOAD_PATH = Config.mapConfig.get("unicomSftpUploadPath");

    public static final String UNICOMPAY_BATCH_SFTP_TEMP_PATH = Config.mapConfig.get("unicombatchSftpTempPath");
    public static final int FIELD_COUNT_UNICOMPAY_RESULT = 5;
    public static final String URL_UNICOMPAY_CALLBACK_ICHANNEL =  Config.mapConfig.get("url_unicompay_callbackichannel");


    public static final String URL_GETRHKDBYNUMBERTEL = Config.mapConfig.get("url_getRhKdByNumberTel");
    public static final int IS_CONTINUE_MONEY_DC = 1;
    public static final int IS_CONTINUE_MONEY_LX = 2;
    public static final int IS_CONTINUE_MONEY_SDZJ = 3;
    public static final int IS_CONTINUE_MONEY_FIRSTYJ = 4;
    public static final int IS_CONTINUE_MONEY_HDYJ = 5;
    public static final int IS_CONTINUE_MONEY_DL = 6;
    public static final int IS_CONTINUE_MONEY_AY = 7;
    public static final String URL_GETCITYCODEBYNAME = Config.mapConfig.get("url_getCityCodeByName");

    public static final String PRODUCT_TYPE_CK = "1";
    //是否为月结
    public static final Integer IS_MONTH = 2;
    public static final Integer IS_NOT_MONTH = 1;
    public static final String URL_DEVELOPMENTERSYNC = Config.mapConfig.get("url_developmentersync");
    public static final String APPID_DEVELOPMENTERSYNC = Config.mapConfig.get("appid_developmentersync");
    public static final String SECRET_DEVELOPMENTERSYNC = Config.mapConfig.get("secret_developmentersync");
    public static final Integer IS_NOT_PUTOUT = 2;
    public static final Integer IS_PUTOUT = 1;

    public static final String REMOVE_TAGE_SUCCESS = "0";
    public static final String USER_STATE_CODESET_SUCCESS = "0";

    public static final int KFK_VALIDATE_RESULT_ZC = 1; //正常
    public static final int KFK_VALIDATE_RESULT_XH = 2; //销户
    public static final int KFK_VALIDATE_RESULT_QF = 3; // 欠费
    public static final int KFK_VALIDATE_RESULT_WZ = 4; //未知状态 查询接口返回无法解析的情况
    public static final int KFK_VALIDATE_RESULT_UDVFAIL = 5;//userid developstaffid 验证不通过


    public static final String FXQYZX_FTP_HOST = Config.mapConfig.get("FXQYZXFtpHost");
    public static final String FXQYZX_FTP_PASSWPRD = Config.mapConfig.get("FXQYZXFtpPassword");
    public static final String FXQYZX_FTP_USERNAME = Config.mapConfig.get("FXQYZXFtpUsername");
    public static final int FXQYZX_FTP_PORT = IceNumberUtils.toInt(Config.mapConfig.get("FXQYZXFtpPort"), 21);
    public static final String FXQYZX_FTP_PATH = Config.mapConfig.get("FXQYZXFtpPath");


    public static final Integer PUSH_USERT_ID_SUCCESS = 1;
    public static final Integer PUSH_USERT_ID_FAIL = 2;
}
